package Song.Han.day01.demo04;
/*
* 方法的重载：
* 1.参数个数不同
* 2.参数类型不同
* 3：参数的多类型顺序不同
* */
public class Demo01MethodOverload {
    public static void main(String[] args) {
        System.out.println(sum(10,10));
        System.out.println(sum(10,10,10));
        System.out.println(sum(10.0,10.0));
        System.out.println(sum(20,20.0));
        System.out.println(sum(20.0,20));

    }

    public static int sum(int a, int b) {
        return a + b;
    }

    //1.参数个数不同
    public static int sum(int a, int b, int c) {
        return a + b + c;
    }

    //2.参数类型不同
    public static double sum(double a,double b) {
        return a + b ;
    }

    //3：参数的多类型顺序不同
    public static double sum(double a,int b) {
        return a + b;
    }

    public static double sum(int a,double b) {
        return a + b;
    }


}